package com.xiangshizhineng.tianzhangzhi.app.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiangshizhineng.tianzhangzhi.app.common.base.BaseService;
import com.xiangshizhineng.tianzhangzhi.app.model.entity.User;
import com.xiangshizhineng.tianzhangzhi.app.model.request.LoginRequest;
import com.xiangshizhineng.tianzhangzhi.app.model.response.DistrictResponse;
import com.xiangshizhineng.tianzhangzhi.app.model.response.LoginResponse;
import com.xiangshizhineng.tianzhangzhi.app.model.response.UserResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<UserResponse> {
 UserResponse findUserById(Long id);
 /**
  * 用户登录
  * @param loginRequest
  * @param request
  */
 LoginResponse login(LoginRequest loginRequest, HttpServletRequest request, HttpServletResponse response) throws IOException;
 /**
  * 退出登录
  * @param request
  */
 void logout(String username, HttpServletRequest request);
 List<UserResponse> tbSuperior(@Param("code")String code, @Param("tzjb")String tzjb);

 @Select("select case tzjb when '3' then '三级田长' when '4' then '网格员' end tzjb from tz_user where xzqdm = #{xzqdm} ")
 List<UserResponse> selectTZ(@Param(Constants.WRAPPER) Wrapper<UserResponse> wrapper);
}
